$(document).ready(function(){

	//Display Loading Image
	function Display_Load()
	{
		$("#loading").fadeIn(900,0);
		$("#loading").html("<img src=resources/images/default/bigLoader.gif />");
	}
	//Hide Loading Image
	function Hide_Load()
	{
		$("#loading").fadeOut('slow');
	};

	//Pagination Click
	$('#memberpagination').live("click", function() {
		Display_Load();

		//CSS Styles
		$("#pagination li")
		.css({'border' : 'solid #dddddd 1px'})
		.css({'color' : '#0063DC'});

		$(this)
		.css({'color' : '#FF0084'})
		.css({'border' : 'none'});

		//Loading Data
		var pageNum  = $(this).attr("page");

		var dataString = 'refresh=1'+'&page_num=' + pageNum;
					
		Display_Load();
		
		$.ajax({
			type : "POST",
			url : "members/list",
			data : dataString,
			cache : false,
			success : function(html) {
				$("#memberdetails").html(html);
			}
		});
		
		Hide_Load();
	});
	
	//Pagination Click
	$('#friendpagination').live("click", function() {
		Display_Load();

		//CSS Styles
		$("#pagination li")
		.css({'border' : 'solid #dddddd 1px'})
		.css({'color' : '#0063DC'});

		$(this)
		.css({'color' : '#FF0084'})
		.css({'border' : 'none'});

		//Loading Data
		var pageNum  = $(this).attr("page");

		var dataString = 'refresh=1'+'&page_num=' + pageNum;
					
		Display_Load();
		
		$.ajax({
			type : "POST",
			url : "relationships/list",
			data : dataString,
			cache : false,
			success : function(html) {
				$("#memberdetails").html(html);
			}
		});
		
		Hide_Load();
	});
	
});
